/**
 * Created by 李柏霖
 * 2020/11/7 20:47
 */

package com.lbl.web.controller.system.syslog;


import com.github.pagehelper.PageInfo;
import com.lbl.domain.system.syslog.SysLog;
import com.lbl.service.system.syslog.ISysLogService;
import com.lbl.web.controller.BaseController;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

@Controller
@RequestMapping("/system/syslog")
@Slf4j
public class SysLogController extends BaseController {

    @Autowired
    ISysLogService iSysLogService;



    @RequestMapping(path = "/toList.do", method = {RequestMethod.GET, RequestMethod.POST})
    public String toList(Model model, @RequestParam(defaultValue = "1") int curr, @RequestParam(defaultValue = "5") int pageSize) {
        //调查询分页列表的方法
        PageInfo<SysLog> pi = iSysLogService.findByPage(curr, pageSize, getLoginCompanyId());
        //将pi添加到页面
        request.setAttribute("pi", pi);
        model.addAttribute("pageSize",pageSize);
        return "system/syslog/log-list";
    }
}